<?php
/*
 * Created by generator
 *
 */

$this->load->helper('form');
$this->load->helper('url');
$this->load->helper('views');
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Editer un activite</title>
<link rel="stylesheet" href="<?=base_url()?>www/css/screen.css" type="text/css" media="screen" title="default" />
<!--[if IE]>
<link rel="stylesheet" media="all" type="text/css" href="<?=base_url()?>www/css/pro_dropline_ie.css" />
<![endif]-->

<!--  jquery core -->
<script src="<?=base_url()?>www/js/jquery/jquery-1.4.1.min.js" type="text/javascript"></script>

<!-- RAPHAEL JS LIBRARY -->
<script src="<?=base_url()?>www/js/raphael-min.js" type="text/javascript" ></script>
<script src="<?=base_url()?>www/js/raphael-calendar.js" type="text/javascript" ></script>
<!-- /RAPHAEL JS LIBRARY -->


<!--  checkbox styling script -->
<script src="<?=base_url()?>www/js/jquery/ui.core.js" type="text/javascript"></script>
<script src="<?=base_url()?>www/js/jquery/ui.checkbox.js" type="text/javascript"></script>
<script src="<?=base_url()?>www/js/jquery/jquery.bind.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
	$('input').checkBox();
	$('#toggle-all').click(function(){
 	$('#toggle-all').toggleClass('toggle-checked');
	$('#ListeAdherents input[type=checkbox]').checkBox('toggle');
	return false;
	});
});
</script>  

<![if !IE 7]>

<!--  styled select box script version 1 -->
<script src="<?=base_url()?>www/js/jquery/jquery.selectbox-0.5.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('.styledselect').selectbox({ inputClass: "selectbox_styled" });
});
</script>
 

<![endif]>

<!--  styled select box script version 2 --> 
<script src="<?=base_url()?>www/js/jquery/jquery.selectbox-0.5_style_2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('.styledselect_form_1').selectbox({ inputClass: "styledselect_form_1" });
	$('.styledselect_form_2').selectbox({ inputClass: "styledselect_form_2" });
});
</script>

<!--  styled select box script version 3 --> 
<script src="<?=base_url()?>www/js/jquery/jquery.selectbox-0.5_style_2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('.styledselect_pages').selectbox({ inputClass: "styledselect_pages" });
});
</script>

<!--  styled file upload script --> 
<script src="<?=base_url()?>www/js/jquery/jquery.filestyle.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
  $(function() {
      $("input.file_1").filestyle({ 
          image: "<?=base_url()?>www/images/forms/choose-file.gif",
          imageheight : 21,
          imagewidth : 78,
          width : 310
      });
  });
</script>

<!-- Custom jquery scripts -->
<script src="<?=base_url()?>www/js/jquery/custom_jquery.js" type="text/javascript"></script>
 
<!-- Tooltips -->
<script src="<?=base_url()?>www/js/jquery/jquery.tooltip.js" type="text/javascript"></script>
<script src="<?=base_url()?>www/js/jquery/jquery.dimensions.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
	$('a.info-tooltip ').tooltip({
		track: true,
		delay: 0,
		fixPNG: true, 
		showURL: false,
		showBody: " - ",
		top: -35,
		left: 5
	});
});
</script> 


<!-- MUST BE THE LAST SCRIPT IN <HEAD></HEAD></HEAD> png fix -->
<script src="<?=base_url()?>www/js/jquery/jquery.pngFix.pack.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$(document).pngFix( );
});
</script>
</head>
<body>

<!-- Start: page-top-outer -->
<div id="page-top-outer">    

<!-- Start: page-top -->
<div id="page-top">

	<!-- start logo -->
	<div id="logo">
	<a href=""><img src="<?=base_url()?>www/images/shared/logo-small.png" alt="" /></a>
	</div>
	<!-- end logo -->
	
	<?= htmlSearch() ?>
	
 	<div class="clear"></div>

</div>
<!-- End: page-top -->

</div>
<!-- End: page-top-outer -->
	
<div class="clear">&nbsp;</div>
 
<!--  start nav-outer-repeat................................................................................................. START -->
<div class="nav-outer-repeat"> 
<!--  start nav-outer -->
<div class="nav-outer"> 

	<?= htmlMyAccount() ?>
	<?= htmlNavigation("activites","edit"); ?>

</div>
<div class="clear"></div>
<!--  start nav-outer -->
</div>
<!--  start nav-outer-repeat................................................... END -->

 <div class="clear"></div>
 
<!-- start content-outer ........................................................................................................................START -->
<div id="content-outer">
<!-- start content -->
<div id="content">

	<!--  start page-heading -->
	<div id="page-heading">
		<h1>Editer une activité</h1>
	</div>
	<!-- end page-heading -->
	
	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="<?=base_url()?>www/images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized"><img src="<?=base_url()?>www/images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td>
		<!--  start content-table-inner ...................................................................... START -->
		<div id="content-table-inner">
		
			<!--  start table-content  -->
			<div id="table-content">
				<!-- start id-form -->
				<h2>Description</h2>
				<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
			
<?
$attributes_info = array('name' => 'EditForm');
$fields_info = array('actidact' => $activite->actidact);
echo form_open_multipart('editactivite/save', $attributes_info, $fields_info );
?>
		<!-- list of variables - auto-generated : -->
		<tr>
			<td nowrap><label title="Nom" for="actlblib">Libellé</label> : </td>
			<td><input type="text" name="actlblib" id="actlblib" class="inp-form-error" value="<?= $activite->actlblib ?>"></td>
			<td>&nbsp;</td>
			<td nowrap><label title="Niveau de l'activité" for="actidniv">Niveau</label> : </td>
			<td>
				<select name="actidniv" id="actidniv" class="styledselect_form_1">
					<?php foreach ($niveaux as $niveau): ?>
					<option value="<?= $niveau->nividniv ?>" <?= ($activite->actidniv == $niveau->nividniv)?("selected"):("") ?>><?= $niveau->nivlbnom ?></option>
					<?php endforeach;?>
				</select>
			</td>
		</tr>
		<tr>
			<td nowrap><label title="Tranche d'age théorique des adhérents" for="actidtra">Tranche d'age</label> : </td>
			<td>
				<select name="actidtra" id="actidtra" class="styledselect_form_1">
					<?php foreach ($tranchesAges as $trancheAges): ?>
					<option value="<?= $trancheAges->traidtra ?>" <?= ($activite->actidtra == $trancheAges->traidtra)?("selected"):("") ?>><?= $trancheAges->tralbnom ?></option>
					<?php endforeach;?>
				</select>
			</td>
			<td>&nbsp;</td>
			<td nowrap><label title="Saison de l'activité" for="actidsai">Saison</label> : </td>
			<td>
				<select name="actidsai" id="actidsai" class="styledselect_form_1">
					<?php foreach ($saisons as $saison): ?>
					<option value="<?= $saison->saiidsai ?>" <?= ($activite->actidsai == $saison->saiidsai)?("selected"):("") ?>><?= $saison->sailbnom ?></option>
					<?php endforeach;?>
				</select>
			</td>
		</tr>
		<tr>
			<td nowrap><label title="professeur qui dirige l'activité (vide = pas de professeur)" for="actidpro">Professeur</label> : </td>
			<td>
				<select name="actidpro" id="actidpro" class="styledselect_form_1">
					<?php foreach ($professeurs as $professeur): ?>
					<option value="<?= $professeur->proidpro ?>" <?= ($activite->actidpro == $professeur->proidpro)?("selected"):("") ?>><?= $professeur->prolbprn ?> <?= $professeur->prolbnom ?></option>
					<?php endforeach;?>
				</select>
			</td>
			<td>&nbsp;</td>
			<td nowrap><label title="activité maintenue lors de la saison" for="actfgmai">Maintenue dans la saison</label> : </td>
			<td>
				<input type="checkbox" name="actfgmai" id="actfgmai" class="inp-form-error" <?= ($activite->actfgmai == "o")?("checked"):("")?>> &nbsp; Oui
			</td>
		</tr>
		<tr>
			<td nowrap><label title="Créneau horaire - jour de la semaine" for="actlbjou">Jour de la semaine</label> : </td>
			<td>
				<select name="actlbjou" id="actlbjou" class="styledselect_form_1">
					<option value="Lundi"		<?= ($activite->actlbjou == "Lundi")?("selected"):("") ?>>Lundi</option>
					<option value="Mardi" 		<?= ($activite->actlbjou == "Mardi")?("selected"):("") ?>>Mardi</option>
					<option value="Mercredi"	<?= ($activite->actlbjou == "Mercredi")?("selected"):("") ?>>Mercredi</option>
					<option value="Jeudi"		<?= ($activite->actlbjou == "Jeudi")?("selected"):("") ?>>Jeudi</option>
					<option value="Vendredi"	<?= ($activite->actlbjou == "Vendredi")?("selected"):("") ?>>Vendredi</option>
				</select>
			</td>
			<td>&nbsp;</td>
			<td nowrap><label title="créneau horaire - heure de début" for="actlbhdb">Heure de début</label> : </td>
			<td><input type="text" name="actlbhdb" id="actlbhdb" class="inp-form-error" value="<?= $activite->actlbhdb ?>"></td>
			<td nowrap>
				<div class="bubble-left"></div>
				<div class="bubble-inner">Au format 00h00</div>
				<div class="bubble-right"></div>
			</td>
		</tr>
		<tr>
			<td colspan="3"></td>
			<td nowrap><label title="créneau horaire - heure de fin" for="actlbdfn">Heure de fin</label> : </td>
			<td><input type="text" name="actlbdfn" id="actlbdfn" class="inp-form-error" value="<?= $activite->actlbdfn ?>"></td>
			<td nowrap>
				<div class="bubble-left"></div>
				<div class="bubble-inner">Au format 00h00</div>
				<div class="bubble-right"></div>
			</td>
		</tr>
		<tr>
			<td nowrap><label title="Situation de l'activité" for="actidsit">Situation</label> : </td>
			<td>
				<select name="actidsit" id="actidsit" class="styledselect_form_1">
					<?php foreach ($situations as $situation): ?>
					<option value="<?= $situation->sitidsit ?>" <?= ($activite->actidsit == $situation->sitidsit)?("selected"):("") ?>><?= $situation->sitlbnom ?></option>
					<?php endforeach;?>
				</select>
			</td>
			<td></td>
			<td nowrap><label title="Cotisation annuelle par adhérent" for="actmocot">Cotisation</label> : </td>
			<td><input type="text" name="actmocot" id="actmocot" class="inp-form" value="<?= $activite->actmocot ?>"></td>
			<td nowrap>
				<div class="bubble-left"></div>
				<div class="bubble-inner">Montant en Euro</div>
				<div class="bubble-right"></div>
			</td>
		</tr>
		<tr>
			<td colspan="4"></td>
			<td>Chiffre d'affaires : <?= $chiffreAffaires ?> €</td>
		</tr>


		<!-- list of variables - auto-generated : -->
		<tr>
			<td colspan="3"></td>
			<td>
				<input type="submit" value="" class="form-submit" />
				<input type="button" value="" class="form-retour"
					onclick="document.location.href='<?=base_url()?>index.php/listactivites';return false;" />
			</td>
		</tr>
	</table>
	
<?
echo form_close('');
?>
			<hr>
				<h2><a name="adherents"><?php if( count($adherents) == 0 ) { ?>Aucun adhérent<?php }else {?>Liste des <?= count($adherents) ?> adhérents<?php }?></a></h2>

				<!--  start product-table ..................................................................................... -->
				<form id="ListeAdherents">
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-check"><a class=" " id="toggle-all"></a></th>
					<!-- table header auto-generated : -->
					<th class="table-header-repeat line-left minwidth-1"><a href="<?=base_url()?>index.php/editactivite/index/<?= $activite->actidact ?>/adhlbnom">Nom</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a href="<?=base_url()?>index.php/editactivite/index/<?= $activite->actidact ?>/adhlbprn">Prénom</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a href="<?=base_url()?>index.php/editactivite/index/<?= $activite->actidact ?>/adhtxadr">Adresse</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a href="<?=base_url()?>index.php/editactivite/index/<?= $activite->actidact ?>/adhlbtel">Téléphone</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a href="<?=base_url()?>index.php/editactivite/index/<?= $activite->actidact ?>/adhlbmai">Adresse e-mail</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a href="#">Photo</a></th>
					
					<th class="table-header-options line-left"><a href="">Actions</a>
					</th>
				</tr>
	<?php
	$even = false;
	$index = 0;
	foreach($adherents as $adherent):
	?>
				<tr <?=($even)?('class="alternate-row"'):('')?>>
					<td><?php if( $adherent->adhlbmai != "" ) {?>
						<input type="checkbox" name="envoiMail[<?=$index?>]" id="envoiMail[<?=$index?>]"
							value="<?=$adherent->adhlbmai?>">
						<?php }?>
					</td>
					<td valign="top"><?=$adherent->adhlbnom?></td> 
					<td valign="top"><?=$adherent->adhlbprn?></td> 
					<td valign="top"><?=$adherent->adhtxadr?></td> 
					<td valign="top"><?=$adherent->adhlbtel?></td> 
					<td valign="top"><a href="mailto:<?=$adherent->adhlbmai?>"><?=$adherent->adhlbmai?></a></td> 
					<td valign="top" style="text-align: center;">
					<?php if ( isset($adherent->adhlbpho) && ($adherent->adhlbpho != null)) {
					?><img src="<?=base_url()?>/www/photosAdherents/thumbnails/<?= $adherent->adhlbpho ?>">
					<?php 
					} ?>
					</td> 
					<td class="options-width">
						<a href="<?=base_url()?>index.php/editadherent/index/<?=$adherent->adhidadh?>" title="Editer" class="icon-1 info-tooltip"></a>
						<!-- a href="<?=base_url()?>index.php/listadherents/delete/<?=$adherent->adhidadh?>" title="Supprimer" class="icon-2 info-tooltip"></a-->
					</td>
				</tr>
	<?php 
		$even = !$even; 
		$index++;
	endforeach; ?>
				</table>
				<!--  end product-table................................... --> 
				</form>

			<!--  start actions-box ............................................... -->
			<div id="actions-box">
				<a href="" class="action-slider activated"></a>

				<div style="display: none;" id="actions-box-slider">
					<a href="javascript:mailToAll('envoiMail', <?= count($adherents) ?>)" class="action-edit">Mail</a>
				</div>
				<div class="clear"></div>
			</div>
			<!-- end actions-box........... -->

<script type="text/javascript">
function mailToAll(tableauId, max){
	mailToString = "";
	for(var i=0; i<max;i++){
		var object = document.getElementById(tableauId+"["+i+"]");
		if( object != null ) {
			if( object.checked ) {
				mailToString += ((mailToString == "")?(""):(",")) + object.value;
			}
		}
	}
	mailToString = "mailto:?bcc=" + mailToString;
	
	document.location.href = mailToString;
}
</script>

			<hr>

			<!-- Calendar -->
			<br><br>
			<h2>Planning</h2>
			<div id="calendar_holder" style="text-align: center;"></div>
<script type="text/javascript">
var paper = preparePaper("calendar_holder");
var resa = drawReservation(paper,"<?= $activite->actlbjou ?>","<?= $activite->actlbhdb ?>","<?= $activite->actlbdfn ?>").attr(
		{fill: "#bebeff", stroke: "#444", opacity: 1}
	);
paper.rect(resa.getBBox().x+1, resa.getBBox().y+1, resa.getBBox().width-2, resa.getBBox().height-2, 4).attr(
		{stroke: "none", gradient: "270-rgba(255, 255, 255, 0)-rgba(200, 200, 255, 1):75",opacity: 0}
	);

var textObj = paper.text( resa.getBBox().x + (resa.getBBox().width/2),
		resa.getBBox().y + (resa.getBBox().height/2),
		"<?= $activite->actlblib ?>").attr({font: configuration.hoursFontSize + 'px "Arial"'});
textObj.attr({fill: "#000"});

</script>
			<!-- /Calendar -->


			</div>
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
	<div class="clear">&nbsp;</div>

</div>
<!--  end content -->
<div class="clear">&nbsp;</div>
</div>
<!--  end content-outer........................................................END -->

<div class="clear">&nbsp;</div>
<?php if(isset($goto) && $goto != null ){ ?>
<script type="text/javascript">
document.location.href="#<?= $goto?>";
</script>
<?php }?>

</body>
</html>